<?php
/**
 * User zgh
 * Email 1803897171@qq.com
 * Date 2022/1/18
 **/

namespace app\admin\pipeline;


use app\common\exception\ServiceException;
use app\common\util\EncryptUtil;

class LoginAdapter extends ItemAdapter
{

    public function checkPassword($input_password)
    {
        if (!$this->checkModel()) {
            throw  new ServiceException("账号或密码错误！");
        }
        if (EncryptUtil::Encrypt($input_password) !== $this->model->password) {
            throw new ServiceException("账号或密码错误！");
        }
        return $this;
    }
}